package com.example.test.启动线程.生成消费lock;

public class Consumer implements Runnable {

    private final Data data;

    public Consumer(Data data) {
        this.data = data;
    }

    @Override
    public void run() {
        while (true) {
            try {
                data.getMessage();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
